<template>
    <div class="box">
        <div v-if="info" class="container" v-html="info.content"></div>
        <empty v-else />
    </div>
</template>

<script>
    import { getProductCombDesc } from "@/api/product";
    import Empty from "@/components/Empty";

    export default {
        data() {
            return {
                info: null,
            };
        },
        components: { Empty },
        beforeCreate() {
            // 添加背景色
            document.querySelector("body").setAttribute("style", "background-color:#ffffff");
        },
        beforeDestroy() {
            document.querySelector("body").setAttribute("style", "");
        },
        async created() {
            let { id } = this.$route.params;
            let info = await getProductCombDesc({ productId: id });
            info ? (this.info = info) : null;
        },
        async mounted() {},
        methods: {},
    };
</script>

<style lang="scss" scoped>
    .container {
        background: #fff;
        padding: 0 10px;
    }
    ::v-deep img {
        width: 100%;
        object-fit: contain;
        height: auto;
    }
    ::v-deep a {
        word-break: break-all;
    }
    .box {
        padding: 0 0 20px;
    }
</style>
